package net.kazed.nextaction;

import java.util.HashMap;
import java.util.Map;

import net.kazed.nextaction.database.TaskType;

/**
 * Application resources.
 * @author Koert Zeilstra
 */
public class ApplicationResource {

    private Map<TaskType, Integer> typeNameResourceMap;
    private Map<TaskType, Integer> typeAbbreviationResourceMap;
    private Map<TaskType, Integer> typeBackgroundResourceMap;

    public ApplicationResource() {
        super();
        typeNameResourceMap = new HashMap<TaskType, Integer>();
        typeNameResourceMap.put(TaskType.IDEA, R.string.task_type_someday);
        typeNameResourceMap.put(TaskType.NEXT_ACTION, R.string.task_type_next_action);
        typeNameResourceMap.put(TaskType.UNPROCESSED, R.string.task_type_unprocessed);
        typeNameResourceMap.put(TaskType.WAITING, R.string.task_type_waiting);

        typeAbbreviationResourceMap = new HashMap<TaskType, Integer>();
        typeAbbreviationResourceMap.put(TaskType.IDEA, R.string.task_type_abbr_someday);
        typeAbbreviationResourceMap.put(TaskType.NEXT_ACTION, R.string.task_type_abbr_next_action);
        typeAbbreviationResourceMap.put(TaskType.UNPROCESSED, R.string.task_type_abbr_unprocessed);
        typeAbbreviationResourceMap.put(TaskType.WAITING, R.string.task_type_abbr_waiting);

        typeBackgroundResourceMap = new HashMap<TaskType, Integer>();
        typeBackgroundResourceMap.put(TaskType.IDEA, R.color.task_type_someday_background);
        typeBackgroundResourceMap.put(TaskType.NEXT_ACTION, R.color.task_type_next_action_background);
        typeBackgroundResourceMap.put(TaskType.UNPROCESSED, R.color.task_type_unprocessed_background);
        typeBackgroundResourceMap.put(TaskType.WAITING, R.color.task_type_waiting_background);
    }

    /**
     * @param type Task type.
     * @return Resource id of name text of type.
     */
    public int getTaskTypeName(TaskType type) {
        return typeNameResourceMap.get(type);
    }

    /**
     * @param type Task type.
     * @return Resource id of abbreviation text of type.
     */
    public int getTaskTypeAbbreviation(TaskType type) {
        return typeAbbreviationResourceMap.get(type);
    }

    /**
     * @param type Task type.
     * @return Resource id of background color of type.
     */
    public int getTaskTypeBackground(TaskType type) {
        return typeBackgroundResourceMap.get(type);
    }
}
